package org.jeese.modules.sys.service.impl;

import java.util.List;

import org.jeese.common.constant.Constant;
import org.jeese.modules.sys.dao.SysMenuDao;
import org.jeese.modules.sys.entity.SysMenu;
import org.jeese.modules.sys.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @Description:菜单service实现类
 * @Package:org.jeese.service.impl
 * @author:wubc
 * @version:1.0
 * @date:2017年11月1日-下午4:51:11
 * @Copyright:2017 Inc. All rights reserved.
 */
@Service("sysMenuService")
public class SysMenuServiceImpl implements SysMenuService{
	@Autowired
	private SysMenuDao menuDao;
	
	@Override
	public List<SysMenu> getAuthMenuList(Long userId) {
		List<SysMenu> list = null;
		if (userId == Constant.SUPER_ADMIN) {
			list = menuDao.getAdminMenuList();
		} else {
			list = menuDao.getUserMenuList(userId);
		}
		return list;
	}

	@Override
	public List<SysMenu> getAdminMenuList() {
		return menuDao.getAdminMenuList();
	}
	
	@Override
	public List<SysMenu> getUserMenuList(Long userId) {
		return menuDao.getUserMenuList(userId);
	}

	@Override
	public List<SysMenu> getAllMenuList() {
		return menuDao.getAllMenuList();
	}

	@Override
	public List<SysMenu> getAllNoButtonMenuList() {
		return menuDao.getAllNoButtonMenuList();
	}

	@Override
	public SysMenu getMenuById(Long menuId) {
		return menuDao.getMenuById(menuId);
	}

	@Override
	public List<SysMenu> getRoleMenuList(Long roleId) {
		return menuDao.getRoleMenuList(roleId);
	}

}
